<?php
/**
 * 后台Index相关
 */
namespace Admin\Controller;
use Think\Controller;
use Think\Exception;

/**
 * 留言内容管理
 */
class MessageController extends CommonController {

    public function index() {
        $conds = array();

        $page = $_REQUEST['p'] ? $_REQUEST['p'] : 1;
        $pageSize = 10;

        $message = D("Message")->getmessage($page,$pageSize);
		
        $count = M("Message")->count();

        $res  =  new \Think\Page($count,$pageSize);
        $pageres = $res->show();
        $this->assign('pageres',$pageres);
        $this->assign('message',$message);
        $this->display();
    }
	
	public function del($id){
		$status = D("Message")->delById($id);
		 if($status > 0 ) {
                return show(1,'删除成功');
            }else{ 
			 return show(0,'删除失败');
		 }
		
	}


}